import Vue from 'vue'
import Router from 'vue-router'
import NotFound from '~/views/404.vue'
import Login from '~/views/Login.vue'
import Admin from '~/views/Admin.vue'
import Notice from '~/views/Notice'
import PlayVoiceTable from '~/views/PlayVoiceTable'
import UserDetail from '~/views/UserDetail'
import Over from '~/views/Over'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: '首页',
      component: Login,
    },
    {
      path: '/login',
      name: '用户登录',
      component: Login
    },
    {
      path: '/notice',
      name: '语音标记说明',
      component: Notice
    },
    {
      path: '/playvoice',
      name: '语音播放',
      component: PlayVoiceTable
    },
    {
      path: '/admin',
      name: '管理员',
      component: Admin
    },
    {
      path: '/404',
      name: 'notFound',
      component: NotFound
    },
    {
      path: '/userdetail',
      name: 'UserDetail',
      component: UserDetail
    },
    {
      path: '/over',
      name: 'Over',
      component: Over,
      meta: {allowBack: false}
    }
  ],
  mode: 'hash',
  /*
  scrollBehavior() {
    history.pushState(null, null, document.URL);
  }*/
})

export default router